package com.zryc.test;

import java.io.Serializable;
import java.util.Objects;

//定义一个部门类型用于测试
public class Department implements Serializable {
    private Integer deptNo;
    private String dname;
    private String city;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Department that = (Department) o;
        return Objects.equals(deptNo, that.deptNo) && Objects.equals(dname, that.dname) && Objects.equals(city, that.city);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deptNo, dname, city);
    }

    @Override
    public String toString() {
        return "Department{" +
                "deptNo=" + deptNo +
                ", dname='" + dname + '\'' +
                ", city='" + city + '\'' +
                '}';
    }

    public Department() {
    }

    public Department(Integer deptNo, String dname, String city) {
        this.deptNo = deptNo;
        this.dname = dname;
        this.city = city;
    }

    public Integer getDeptNo() {
        return deptNo;
    }

    public void setDeptNo(Integer deptNo) {
        this.deptNo = deptNo;
    }

    public String getDname() {
        return dname;
    }

    public void setDname(String dname) {
        this.dname = dname;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }
}
